package com.lch.webdemo.common.enums;


import org.apache.commons.lang3.StringUtils;

/**
 * 菜单点击事件
 *
 * @author: liuchenhui
 * @create: 2018-12-17 23:46
 **/
public enum MenuClickMsgEnum {
    /**
     * 答案之书菜单
     */
    ANSWER_BOOK_MENU("answer_book_id", "image", ""),
    RSTJ_GAME_MENU("rstj_game_id", "image", ""),
    SIGN_BLESSING_MENU("sign_bless_id", "text", "回复【开工】参与活动，领取您的2019开工福签，祝你新一年新好运！");

    private String key;
    private String type;
    private String content;

    MenuClickMsgEnum(String key, String type, String content) {
        this.key = key;
        this.type = type;
        this.content = content;
    }

    public static MenuClickMsgEnum findMenuByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return ANSWER_BOOK_MENU;
        }
        switch (key) {
            case "answer_book_id":
                return ANSWER_BOOK_MENU;
            case "rstj_game_id":
                return RSTJ_GAME_MENU;
            case "sign_bless_id":
                return SIGN_BLESSING_MENU;
        }
        return null;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getKey() {
        return key;
    }

    public String getType() {
        return type;
    }

    public String getContent() {
        return content;
    }
}
